from fastapi import FastAPI
import uvicorn

# 创建应用程序
app = FastAPI()

# 定义一个接口
@app.get("/")
async def index():
    return {"message": "Hello World"}

if __name__ == "__main__":
    # 启动应用程序
    uvicorn.run(app, host="127.0.0.1", port=8000)